<?php
/**
 * demo data base class
 *
 * provide fake data for all product, api and test case
 *
 * @author lizhili <ycaihappy@163.com>
 *
 * @date 2010-10-15
 */

class DemoData 
{
    static public $_p;

    static public function set($type)
    {
        self::$_p = $type.__CLASS__;
    }

    static public function get($method, $params=array(), $ret=0)
    {
        $a = self::$_p;
        $result = $a::$method($params);
        if (0 == $ret)
        {
            $return_str = self::format_json($result);
        }
        else
        {
        }
        return $return_str;
    }

    static public function format_xml()
    {
    }

    static public function format_json($result)
    {
        return json_encode($result);
    }

    /**
     * load all demo data
     */
    static public function load()
    {
    }

    static public function build($yaml)
    {
    }

    /**
     * use yaml define the demo data 
     */
    static public function parse($yamlfile)
    {
    }
}



?>
